//
//  HHScrollSegmentView.h
//  Flower
//
//  Created by 花花 on 2016/12/5.
//  Copyright © 2016年 花花. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "HHSegmentStyle.h"
#import "HHScrollPageViewDelegate.h"
@class HHTitleView;
typedef void(^TitleBtnOnclickBlock)(HHTitleView *titleView,NSInteger index);
typedef void(^tempBtnOnClick)(UIButton *tempBtn);
@interface HHScrollSegmentView : UIView

//所有的标题
@property(nonatomic, strong) NSArray *titles;


@property(nonatomic, strong) HHSegmentStyle *segmentStyle;


@property(nonatomic, copy) tempBtnOnClick tempBtnOnClick;


@property(nonatomic, weak) id<HHScrollPageViewDelegate> delegate;


@property(nonatomic, strong) UIImage *backgroundImage;


//初始化

-(instancetype)initWithFrame:(CGRect)frame segmentStyle:(HHSegmentStyle *)segmentStyle delegate:(id<HHScrollPageViewDelegate>)delegate titles:(NSArray *)titles titleDidClick:(TitleBtnOnclickBlock)titleDidClick;


//切换下标的时候根据progress同步设置UI
-(void)adjustUIWithProgress:(CGFloat)progress oldIndex:(NSInteger)oldIndex currentIndex:(NSInteger)currentIndex;
//让选中的标题居中
-(void)adjustTitleOffSetToCurrentIndex:(NSInteger)currentIndex;

//设置选中的下标
-(void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated;

//重新刷新标题的内容
-(void)reloadTitlesWithNewTitles:(NSArray *)titles;


@end
